﻿<phone:PhoneApplicationPage 
    x:Class="HangzhouTour.PageImage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    OrientationChanged="PhoneApplicationPage_OrientationChanged"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.Resources>
            <Style TargetType="Image">
                <Setter Property="Stretch" Value="Uniform" />
            </Style>
        </Grid.Resources>

        <ItemsControl  x:Name="imgs"
                       ItemsSource="{Binding}"
                       HorizontalAlignment="Stretch" 
                       VerticalAlignment="Stretch">
            <ItemsControl.Template>
                <ControlTemplate  >
                    <Border>
                        <ScrollViewer HorizontalContentAlignment="Center" 
                                      HorizontalScrollBarVisibility="Auto">
                            <ItemsPresenter />
                        </ScrollViewer>
                    </Border>
                </ControlTemplate>
            </ItemsControl.Template>
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel  Orientation="Horizontal" />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Image 
                        Width="480"
                Source="ScenicSpots/xixishidi.jpg">
                        <Image.RenderTransform>
                            <CompositeTransform  />
                        </Image.RenderTransform>
                        <toolkit:GestureService.GestureListener >
                            <toolkit:GestureListener 
                     DragStarted="GestureListener_DragStarted"
                     DragDelta="GestureListener_DragDelta"
                     DragCompleted="GestureListener_DragCompleted"
                     Tap="GestureListener_Tap"
                    DoubleTap="GestureListener_DoubleTap"
                     Hold="GestureListener_Hold"
                     PinchCompleted="GestureListener_PinchCompleted"
                     PinchDelta="GestureListener_PinchDelta"
                     PinchStarted="GestureListener_PinchStarted"
                    />
                        </toolkit:GestureService.GestureListener>
                    </Image>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>

    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</phone:PhoneApplicationPage>
